﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HexTileBoard
{
    public static class BoardVariables
    {
        // AI should wait till updating influence is done before making another move
        public static bool UpdatingInfluence = false;

        // Percentage of board to occupy to win
        public static float PercentOfBoard = .6f;

        // Camera variables
        public static float cameraFarAdjustment = 340.0f;

        // tile variables
        public static float tileModelWidth = 72.0f;
        public static float tileModelDepth = 44.0f;
        public static float tileModelHeight = 100.0f;

        // scale for boundingsphere for tiles
        public static float boundingScale = 3.0f;    // the larger the number, the smaller the radius

        // Increment for tiles when upgrading
        public static float tileIncrement = 15.0f;

        // How fast the tiles elevate when being upgraded
        public static float tileElevationSpeed = 0.06f;
        public static float tileReductionSpeed = 0.02f;
        
        // How much elevation for the billboarded items
        public static float billboardElevation = 20.0f;
        
        // how to restrict camera movement
        public static Microsoft.Xna.Framework.BoundingSphere boundingSphere;

        // How far a cannon can shoot
        public static float cannonDistance = 60.0f;

        // Associated costs
        public static int CannonFiringCost = 1;
        public static int DefensiveWoodCost = 20;
        public static int DefensiveStoneCost = 20;
        public static int DefensiveClayCost = 20;
        public static int BridgeWoodCost = 10;
        public static int BridgeClayCost = 5;
        public static int BridgeStoneCost = 5;
        public static int Influence1WoodCost = 5;
        public static int Influence1ClayCost = 5;
        public static int Influence1StoneCost = 5;
        public static int Influence1WheatCost = 2;
        public static int Influence2WoodCost = 10;
        public static int Influence2ClayCost = 10;
        public static int Influence2StoneCost = 5;
        public static int Influence2WheatCost = 2;
        public static int Influence3WoodCost = 20;
        public static int Influence3ClayCost = 10;
        public static int Influence3StoneCost = 15;
        public static int Influence3WheatCost = 5;

        public static int AIStartWaitTime = 1000;   // How long to wait till the AI starts thinking on it's turn
        public static int AIMaxWaitTime = 10000;    // The longest the AI can think
        public static int AIMinWaitTime = 2000;     // The minimum length AI has to wait before ending turn (total is start + min)

        public static readonly string[] GameHints =
        {
            "Deserts cannot spread influence under any circumstance, so use them to block opponents.",
            "Crossing rivers requires plenty of wood, but can be useful to get behind an opponent.",// this is the max width a line can be within the 10% bounds
            "The more upgraded a tower is, the farther it can fire.",
            "Defensive towers are costly and cannot be upgraded,\nbut do not require wheat and cannot be destroyed.",
            "The more influence you have on a tile, the more resources you collect from it.",
            "A player can win by covering the majority of the board with influence,\nor by maxing out resources.",
            "A blocker made of defensive towers can be useful to sit and hoard resources.",
            "Use upgraded towers to attack distant bridges and opposing towers to reduce them.",
            "Make strategic alliances against troublesome opponents.",
        };
    }

    /// <summary>
    /// Possible sizes for the board.
    /// </summary>
    public enum BoardSize : short
    {
        Tiny = 9,
        Small = 12,
        Medium = 15,
        Big = 20,
        Huge = 25,
    }

    /// <summary>
    /// Possible colors for players
    /// </summary>
    public enum PlayerColor
    {
        None = -1,
        Red = 0,
        Blue = 1,
        Green = 2,
        Yellow = 3,
    }
    /// <summary>
    /// Types of packets that are sent in online gameplay.
    /// The types are:
    /// InitWorld: sends the number of players and a seed to generate the world
    /// PlayerAction: sends an int defining the action (end turn/upgrade/reduce), and int source index, and an int target index
    /// GameOver: sends an int indicating player color who won and an int indicating how they won
    /// </summary>
    public enum PacketTypes
    {
        InitWorld,
        PlayerAction,
        GameOver,
    }

    /// <summary>
    /// Types of actions a player can send over packets
    /// </summary>
    public enum PlayerActions
    {
        EndTurn,
        UpgradeTower,
        ReduceTower,
    }
}
